<script type="text/javascript" src="<?php echo URL::base()?>js/member.js"></script>
<div id="dialog-form" title="<?php echo $current_tab["display_name"];?>"></div>
<div id="bindDialog" title="绑定商家"></div>
<div id="supplier-contain" class="ui-widget">
<div>
	<span>按
	<select id="queryType">
		<option value="username">用户名</option>
		<option value="contact">联系人</option>
		<option value="number">电话/手机/QQ</option>
		<option value="weixin">微信</option>
		<option value="weibo">微博</option>
		<option value="address">地址</option>
	</select>
	<input type="text" name="queryText" id="queryText" style="display: inline;float: none;" class="ui-widget-content ui-corner-all" value="<?php if (!empty($result_search_text)) echo $result_search_text?>"/>
	<button id="query-member">查询</button>
	</span>
</div>
<table id="supplier" class="ui-widget ui-widget-content">
	<thead>
		<tr class="ui-widget-header ">
			<th><input type="checkbox" onclick="changeSelectAll(this,'checkKey');"></th>
			<th>用户名</th>
			<th>联系人</th>
			<th>电话</th>
			<th>手机</th>
			<th>邮箱</th>
			<th>地址</th>
			<th>QQ</th>
			<th>微信</th>
			<th>微博</th>
			<th>备注</th>
			<th>操作</th>
		</tr>
	</thead>
	<tbody>
	<?php
	foreach ($model_result as $item){
		echo '<tr><td><input type="checkbox" class="checkKey" key="'.$item->id.'"/></td>';
		echo '<td>';
		if ($item->issupplier == "Y"){
			echo '<span style="color:red">[商家]</span>';
		}
		echo $item->username.'</td>';
		echo '<td>'.$item->contact.'</td>';
		echo '<td>'.$item->phone.'</td>';
		echo '<td>'.$item->telephone.'</td>';
		echo '<td>'.$item->email.'</td>';
		echo '<td>'.$item->address.'</td>';
		echo '<td>'.$item->qq.'</td>';
		echo '<td>'.$item->weixin.'</td>';
		echo '<td>'.$item->weibo.'</td>';
		echo '<td>'.$item->desc.'</td>';
		echo '<td><button class="bindSupplierBtn" memberid="'.$item->id.'">绑定商家</button>&nbsp';
		echo '<button class="editMemberBtn" memberid="'.$item->id.'">修改</button>&nbsp;';
		echo '<button class="delMemberBtn" memberid="'.$item->id.'">删除</button></td>';
	}?>
	</tbody>
</table>
<div class="page clear"><?php echo $page_links;?></div>
<button id="create-member">添加会员</button>
<button id="edit-member">修改会员</button>
<button id="delete-member">删除选中会员</button>
</div>
